Microprocessors may employ transaction-based processing where operations (e.g., arithmetic, logical, memory, branch, floating point, etc.) are organized into indivisible sets, referred to as transactions. Each transaction succeeds or fails in being processed by the microprocessor as a complete unit. In other words, the microprocessor ensures that either all operations in a transaction are completed without error, or none of them are completed. If some of the operations are completed but errors occur when the other operations are attempted, the microprocessor “rolls back” all of the operations of the transaction (including the successful ones), thereby erasing all traces of the transaction and restoring the system to a consistent, known state from which the microprocessor began processing the transaction. If all operations of a transaction are completed successfully, the transaction is committed by the microprocessor, all changes are made permanent, and the known state is updated.
Transaction processing guards against hardware and software errors that might leave a transaction partially completed, which may result in an unknown, inconsistent state. For example, if an agent (e.g., a processing core, a direct memory access (DMA) snooping memory controller, an instruction fetch unit, etc.) that is not involved in the transaction attempts to access or modify data that is involved in the transaction, the transaction processing system guarantees that all operations in any uncommitted (i.e., not completely processed) transactions are rolled back, and a consistent state is restored. By tracking a known and consistent state of the microprocessor and rolling back to such a state if a transaction cannot be committed, the integrity of data in the microprocessor can be protected against corruption and operating stability of the microprocessor can be increased.
Although rolling back a transaction protects against data corruption, there are performance penalties associated with roll backs. For example, a penalty of additional operations being processed is paid during recovery from a roll back relative to a successfully committed transaction. In particular, performance penalties may be significant for large or long running transactions.